export interface TextType {
  name: string;
  value: string;
}
export interface TextTypeAction {
  type: 'add' | 'edit';
  value: TextType;
}
export const initData: TextType[] = [
  {
    name: '123',
    value: '12333',
  },
  {
    name: '456',
    value: '45666',
  },
  {
    name: '789',
    value: '78999',
  },
];
export function ReducerTest(tasks: TextType[], action: TextTypeAction) {
  switch (action.type) {
    case 'add': {
      return [...tasks, action.value];
    }

    case 'edit': {
      return [...tasks, action.value];
    }

    default: {
      return tasks;
    }
  }
}
